import {sleep} from "./sleep";
import {epoint} from "./epoint";
import {user} from "./user";
import {lpoint} from "./lpoint";
import {spoint} from "./spoint";

export class score2018{

    constructor(user_account){

        this.user=new user();
        this.points=[
            /*new lpoint(this.user,2),        //刷登录的*/
            new epoint(this.user,5,60,80)  //刷考试的
            ,new spoint(this.user,5,11)     //刷时间的*/
            //,new ipoint(this.user,1)  //刷个人信息的
            //,new lpoint(this.user,1)
        ];

        this.interval=1000;
    }

    async async_excute(){

        if(this.points&&this.points.length>0){
            if(!await this.user.check()) return;

            for(let point of this.points){
                await point.async_excute();
            }

            /*await Promise.all(this.points.map(p =>p.async_excute()));*/
            console.log(this.user.userAccount+":完成")
        }

    }


    async excute(){

        if(this.points&&this.points.length>0){
            if(!await this.user.check()) return;

            for(let point of this.points){
                await point.excute();
            }

            /*await Promise.all(this.points.map(p =>p.async_excute()));*/
            console.log(this.user.userAccount+":完成")
        }

    }





}